package com.example.runningdemo;

import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Method;

/**
 * @program: Running-Demo
 * @description:
 * @author: kangwei
 * @create: 2024-08-07 09:03
 **/
public class Demo {

    public static void main(String[] args) {
        try {
            Class<?> aClass = Class.forName("com.example.runningdemo.entity.Salary");
            System.out.println(aClass);
            Annotation[] declaredAnnotations = aClass.getDeclaredAnnotations();
            System.out.println(declaredAnnotations);
            for (Field declaredField : aClass.getDeclaredFields()) {
                System.out.println(declaredField);
            }
            System.out.println(aClass.getClassLoader());
            for (Method declaredMethod : aClass.getDeclaredMethods()) {
                System.out.println(declaredMethod);
                //  declaredMethod.invoke()
            }
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
    }
}
